package com.nisco.dms.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * 权限清单实体类
 * 
 */
@Entity
@Table(name = "Ds_Permission")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "com.nisco.dms.entity")
public class Permission extends CoreEntity {
	
	@Column(length = 20)
	private String strSn;

	@Column(nullable = false, length = 100)
	private String strName;
	
	@Column(length = 255)
	private String strDesc;

	@ManyToOne
	@JoinColumn(name = "moduleId")
	private Program program;

	public String getStrSn() {
		return strSn;
	}

	public void setStrSn(String strSn) {
		this.strSn = strSn;
	}

	public String getStrName() {
		return strName;
	}

	public void setStrName(String strName) {
		this.strName = strName;
	}

	public String getStrDesc() {
		return strDesc;
	}

	public void setStrDesc(String strDesc) {
		this.strDesc = strDesc;
	}

	/*public Menu getModule() {
		return module;
	}

	public void setModule(Menu module) {
		this.module = module;
	}
	
	
*/
	/**
	 * reflectionToString将对象输出为string类型。
	 */
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	public Program getProgram() {
		return program;
	}

	public void setProgram(Program program) {
		this.program = program;
	}

}
